package com.roc.web.action.windcontroll;

import java.util.ArrayList;
import java.util.List;

import com.roc.page.BaseSearchCondition;
import com.roc.page.WhereHQLFieldBean;
import com.roc.util.Constance;

@SuppressWarnings("serial")
public class ReturnCodeSearchCondition extends BaseSearchCondition{
  
	private String reValue;   //编码值
	private String reExplan;  //返回码类型
	
	private String returnName;
	
	@Override
	protected List<WhereHQLFieldBean> getWhereHQLFieldBeanList() {
		List<WhereHQLFieldBean> filedBeanList = new ArrayList<WhereHQLFieldBean>();
		//编码值
		if(Constance.isNotEmpty(reValue))
		{
			filedBeanList.add(new WhereHQLFieldBean("T.RETURN_VALUE", reValue,"=", false));
		}
		//编码类型
		if(Constance.isNotEmpty(reExplan)&&!"999".endsWith(reExplan)){
			filedBeanList.add(new WhereHQLFieldBean("T.RETURN_EXPLAN", reExplan.trim(), "like", false,"ALL"));
		}
		return filedBeanList;
	}

	@Override
	protected String getRowCountHQL() {
		StringBuffer sb=new StringBuffer();
		sb.append(" SELECT COUNT(*) FROM apstfr.tbl_mgm_risk_code  T WHERE  T.REMARK1='1' ");
		return sb.toString();
	}

	@Override
	protected String getSearchHQL() {
		StringBuffer sb=new StringBuffer();
		sb.append(" SELECT T.RETURN_VALUE,T.RETURN_EXPLAN FROM apstfr.tbl_mgm_risk_code  T WHERE  T.REMARK1='1' ");
		return sb.toString();
	}

	@Override
	protected String getOrderPartOfHQL() {
		// TODO Auto-generated method stub
		return " ";
	}

	public String getReValue() {
		return reValue;
	}

	public void setReValue(String reValue) {
		this.reValue = reValue;
	}

	public String getReExplan() {
		return reExplan;
	}

	public void setReExplan(String reExplan) {
		this.reExplan = reExplan;
	}

	public String getReturnName() {
		return returnName;
	}

	public void setReturnName(String returnName) {
		this.returnName = returnName;
	}

  
	
	
}
